<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>荩美国际商城</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no">
  <link href="/resources/css/style.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="/resources/js/jquery-1.8.1.min.js"></script>
</head>
<body>

<Div class="xtfhmain">
  <div class="xtflogo"></div>
  <div class="xtfcont">
    <h2>系统信息</h2>
    <div class="xfttext"> ${msg}</div>
  </div>


</div>

<form id="back_form" method="post">

  <input type="hidden" name="orderId" id="orderId" value="${orderId}"/>
  <input type="hidden" name="code" id="code"/>
  <input type="hidden" name="msg" id="msg"/>
  <input type="hidden" name="extend" id="extend"/>

</form>
</Div>
</body>
<script type="text/javascript">
  $(function(){
    var orderNo = $("#orderId").val();

    if(orderId!=null&&orderId!=''){
      window.setTimeout(back,1000);
    }
  })
  function back(){

    $.ajax({
      url:"/front/order/queryOrderStatus?r="+Math.random(),
      type:"post",
      data:{
        orderNo: $("#orderNo").val()
      },
      success:function(res){

        if(res.success){

          if(res.data!=null){

            $("#back_form").attr("action",res.data.callback);
            if(res.data.status=='PAYSUC'){
              $("#code").val("success");
              $("#msg").val("支付成功");
            }else{
              $("#code").val("fail");
              $("#msg").val("支付失败");
            }
            $("#orderNo").val(res.data.orderNo);
            $("#extend").val(res.data.remark);
            $("#back_form").submit();
          }
        }
      },
      error:function(){

      }
    });
  }
</script>
</html>


